package com.neiquan.weiguan.fragment;

import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.neiquan.weiguan.R;
import com.neiquan.weiguan.activity.ContainerActivity;
import com.neiquan.weiguan.bean.ChannelItem;
import com.neiquan.weiguan.fragment.base.AppBaseFragment;
import com.neiquan.weiguan.utils.Constant;

import net.neiquan.applibrary.utils.LogC;

import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.OnClick;

/**
 * 我要爆料
 */
public class TipOffFragment extends AppBaseFragment {

    @InjectView(R.id.text_tipoff_fragment_type)
    TextView mTextTipoffFragmentType;
    @InjectView(R.id.lin_tipoff_fragment_type)
    LinearLayout mLinTipoffFragmentType;
    @InjectView(R.id.edit_tipoff_fragment_title)
    EditText mEditTipoffFragmentTitle;
    @InjectView(R.id.text_tipoff_fragment_content)
    EditText mTextTipoffFragmentContent;

    @Override
    public View initRootView() {
        rootView = LayoutInflater.from(getContext()).inflate(R.layout.fragment_tipoff, null);
        ButterKnife.inject(this, rootView);
        return rootView;
    }

    @Override
    public void setViews() {
        setTitleTv("我要爆料");
    }

    @Override
    public void initData() {

    }

    @OnClick({R.id.lin_tipoff_fragment_type, R.id.img_tipoff_fragment_addpic})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.lin_tipoff_fragment_type:
                ContainerActivity.startActivityForResurt(getActivity(), MenuFragment.class, null, Constant.ONACTIVITYRESULT_MENUSELECT);
                break;
            case R.id.img_tipoff_fragment_addpic:
                break;
        }
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        ChannelItem channelItem= (ChannelItem) data.getSerializableExtra("data");
        mTextTipoffFragmentType.setText(channelItem.getName());
    }
}
